<template>
  <!-- 菜单收起的这个功能没有做，需要的话在做吧 -->
  <div class="dm-menu">
    <el-scrollbar class="dm-scroll">
      <!-- 循环菜单 -->
      <el-menu
        :router="true"
        :default-active="$route.path"
        :collapse="$store.state.collapsed"
        :unique-opened="false"
        style="min-height: 100vh;"
        background-color="#20222A"
        text-color="#fff"
        active-text-color="#2a877a"
        :collapse-transition="false"
        mode="vertical"
      >
        <custom-menu-tree :data="menu_data"></custom-menu-tree>
      </el-menu>
    </el-scrollbar>
  </div>
</template>

<script>
import CustomMenuTree from "@/components/CustomMenuTree";
export default {
  components: {
    CustomMenuTree
  },
  data() {
    return {
      menu_data:[
            // {
            //     id: 12,
            //     name: "数据概况",
            //     url: "/data"
            // },
            // {
            //     id: 13,
            //     name: "服务内容",
            //     url: "/service-content"
            // }
          ]
    };
  },
  mounted() {
   this.get_menus();
  },
  methods: {
    get_menus(){
      console.log(this.menu_data);
      this.$http.post("common/menus",{page:this.page,limit:this.pagesize}).then((response) => {
        // this.total=response.data.total;
        this.menu_data=response.data.menu;
        console.log(response.data.menu);
      })
    },
  },
  };
</script>
